//
//  ProjectHeaderView.m
//  一点互助
//
//  Created by mac on 16/8/22.
//  Copyright © 2016年 zhangboqiu. All rights reserved.
//

#import "ProjectHeaderView.h"
#import "UserModel.h"
#import "LifeViewController.h"
#import "FunViewController.h"
#import "HelpViewController.h"
#import "UserModel.h"
#import "MemberViewController.h"
#import "WishListViewController.h"

@implementation ProjectHeaderView

+ (instancetype)loadMyHeaderView {
    ProjectHeaderView *view = [[[NSBundle mainBundle] loadNibNamed:@"ProjectHeaderView" owner:nil options:nil] firstObject];
    return view;
}

- (IBAction)lifeButtonTaped:(id)sender {
    LifeViewController *LifeVC = [[LifeViewController alloc]init];
    [self.ownerVC.navigationController pushViewController:LifeVC animated:YES];
}

- (IBAction)funnyButtonTaped:(id)sender {
    FunViewController *FunVC = [[FunViewController alloc]init];
    [self.ownerVC.navigationController pushViewController:FunVC animated:YES];
}

- (IBAction)helpEachOtherTaped:(id)sender {
    HelpViewController *HelpVC = [[HelpViewController alloc]init];
    [self.ownerVC.navigationController pushViewController:HelpVC animated:YES];
}

- (IBAction)ownerWishTaped:(id)sender {
    UserModel *user = [UserModel sharedUserModel];
    if (user.islogin) {
        WishListViewController *wishListVC = [[WishListViewController alloc]init];
        [self.ownerVC.navigationController pushViewController:wishListVC animated:YES];
    }else {
        MemberViewController *loginVC = [[MemberViewController alloc]init];
        [self.ownerVC.navigationController pushViewController:loginVC animated:YES];
    }
}

- (IBAction)helpMeTaped:(id)sender {
    UserModel *user = [UserModel sharedUserModel];
    if (user.islogin) {
        
    }else {
        MemberViewController *loginVC = [[MemberViewController alloc]init];
        [self.ownerVC.navigationController pushViewController:loginVC animated:YES];
    }
}

@end
